package com.lipl.base.javase.designpattern.decoartor.V2;

import com.lipl.base.javase.designpattern.decoartor.V1.BattercakeWithEgg;
import com.lipl.base.javase.designpattern.decoartor.V1.BattercakeWithEggAndSausage;

/**
 * @Auther: 15541
 * @Date: 2020/12/16 10:01
 * @Description:
 */
public class BattercakeTest {

    public static void main(String[] args) {

        Battercake battercake;

        //路边摊买一个煎饼
        battercake = new BaseBattercake();
        //煎饼有点小，想再加一个鸡蛋
        battercake = new EggDecorator(battercake);
        //再加一个鸡蛋
        battercake = new EggDecorator(battercake);
        //很饿，再加根香肠
        battercake = new SausageDecorator(battercake);

        System.out.println(battercake.getMsg()+"总价:"+ battercake.getPrice());

    }
}

